# evince
# Builds from https://github.com/puppylinux-woof-CE/petbuilds

. ../func
. ../build.conf

URL=http://ftp.gnome.org/pub/gnome/sources/evince/2.32/
PKG=evince
VER=2.32.0
COMP=tar.bz2
DESC="Light weight PDF viewer"
DEPS=+libspectre,libdjvulibre,+poppler,+gtk+2
CAT=Document
DESKTOP=evince.desktop
CWD=$(pwd)
[ -z "$MWD" ] && MWD=$(dirname $CWD)	
[ -z "$BUILD" ] && BUILD=$DEF_BUILD
[ -f "$DESKTOP" ] || DESKTOP=not
[ -z "$DEPS" ] && DEPS=not	

ARCH=$(uname -m)
case $ARCH in
 *64) 	LIBDIR=$LIBCONF64 ;;
 arm*)	LIBDIR=$LIBCONFarm;;
 *) 	LIBDIR=$LIBCONF32 ;;
esac

build() {
	cd ${PKG}-${VER}
	# get rid of gnome-icon-theme dependency - how stupid is that?
	xxx='SHELL_PLATFORM_PKGS="gnome-icon-theme >= $GNOME_ICON_THEME_REQUIRED"'
	sed -i "/$xxx/d" configure
	./configure --prefix=/usr \
				--localstatedir=/var \
				--sysconfdir=/etc \
				--libdir=/usr/${LIBDIR} \
				--enable-pixbuf \
				--without-gconf \
				--without-keyring \
				--disable-nautilus \
				--disable-help \
				--disable-scrollkeeper \
				--disable-schemas-install \
				--disable-dbus \
				--disable-static
	[ "$?" -eq 0 ] || exit
	make $MKFLG
	[ "$?" -eq 0 ] || exit
	make DESTDIR=$CWD/$PKG-install install
	cd -
	mkdir -p $PKG-install/usr/share/pixmaps
	cp -af evince.svg $PKG-install/usr/share/pixmaps/
}
	
# main
retrieve ${PKG}-${VER}.${COMP}
extract ${PKG}-${VER}.${COMP}
build
package_std $PKG $VER $ARCH $DESKTOP "$DESC" $DEPS $CAT
